package app;

import com.dinim.matrix.twodimensional.Vector3;


public class PhytbaumData {

	private Vector3[] startQuad;
	
	private double spitzX;
	private double spitzY;
	
	private double alpha;
	private double beta;
	
	private double alphaRatio;
	private double betaRatio;
	
	public Vector3[] getStartQuad() {
		return startQuad;
	}
	public void setStartQuad(Vector3[] startQuad) {
		this.startQuad = startQuad;
	}
	public double getSpitzX() {
		return spitzX;
	}
	public void setSpitzX(double spitzX) {
		this.spitzX = spitzX;
	}
	public double getSpitzY() {
		return spitzY;
	}
	public void setSpitzY(double spitzY) {
		this.spitzY = spitzY;
	}
	public double getAlpha() {
		return alpha;
	}
	public void setAlpha(double alpha) {
		this.alpha = alpha;
	}
	public double getBeta() {
		return beta;
	}
	public void setBeta(double beta) {
		this.beta = beta;
	}
	public double getAlphaRatio() {
		return alphaRatio;
	}
	public void setAlphaRatio(double alphaRatio) {
		this.alphaRatio = alphaRatio;
	}
	public double getBetaRatio() {
		return betaRatio;
	}
	public void setBetaRatio(double betaRatio) {
		this.betaRatio = betaRatio;
	}
	
	public PhytbaumData(Vector3[] startQuad){
		this.startQuad = startQuad;
	}
	
	public void changeSpitze(double x, double y){
		spitzX = x;
		spitzY = y;
		
		Line l = new Line(startQuad[0].getX(), startQuad[0].getY(), x, y);
		
		double H = l.getLength();
		alphaRatio = H / (startQuad[1].getX() - startQuad[0].getX());
		double G = y - startQuad[0].getY();
		
		this.alpha = Math.toDegrees(Math.asin(G/H));

		l = new Line(x, y, startQuad[1].getX(), startQuad[1].getY());
		
		H = l.getLength();
		betaRatio = H / (startQuad[1].getX() - startQuad[0].getX());
		G = startQuad[1].getY() - y;
		
		this.beta = Math.toDegrees(Math.asin(G/H));
		
		//alphaBranchRatio = H / startLineLength;
	}
	
	
}
